package io.gitee.hejiang;

import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(value = "keycloak.enabled", matchIfMissing = true)
public class SwaggerSqlKeycloakClientConfiguration {
	/**
	 * KeycloakAutoConfiguration needs KeycloakSpringBootConfigResolver bean to
	 * initiate It looks like a bug of keycloak-spring-boot-starter version 9.0.0
	 */
	@Bean
	public KeycloakSpringBootConfigResolver keycloakConfigResolver() {
		return new KeycloakSpringBootConfigResolver();
	}
}
